<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let obj = {
      uname: '刘德华',
      //方法
      song: function () {
        console.log('冰雨')
        document.write(`冷冷的冰雨在脸上胡乱地拍`)
      },  //依然用英文逗号分隔
      sum: function (x, y) {
        console.log(x + y)
      }
    }
    //方法调用 对象名.方法名
    obj.song()
    obj.sum(1, 2)
    console.log(obj['uname'])
    obj["sum"](3, 2)
  </script>
</body>

</html>